package com.salt.config;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.time.LocalDate;

/**
 * 应用配置
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "app")
public class AppConfig {
    
    /**
     * 登录截止日期
     */
    private String loginDeadline;
    
    /**
     * 获取登录截止日期
     */
    public LocalDate getLoginDeadlineDate() {
        return StringUtils.isNotEmpty(loginDeadline)?LocalDate.parse(loginDeadline):null;
    }
} 